package BM;

import org.apache.commons.codec.binary.Base64;

import java.security.KeyPair;
import java.security.PublicKey;

/**
 * @author konley
 * @date 2021-12-11 11:26
 */
public class SenderA {
    //需要加密的明文消息m
    private String m = "We'll meet at the school gate at eight thirty tomorrow morning.";

    //加密并发送
    public String send(String puk) throws Exception {
        PublicKey publicKey = RSA.getPublicKey(puk);
        // RSA加密得到密文A
        String y = RSA.encrypt(m,publicKey);
        return y;
    }
}
